]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
inputMethod: Avoid calling set_preedit_text() if unnecessary
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 13 Nov 2018 17:26:13 +0000 (18:26 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Tue, 13 Nov 2018 17:52:15 +0000 (18:52 +0100)
This is easier down on clients.

js/misc/inputMethod.js

index 4a92dc49bf5dfe4962141e6c24ce1cd744daf0f0..e22dfccc5bd37d5a0e908cf230e91b7832ac352a 100644 (file)
@@ -144,8 +144,11 @@ var InputMethod = new Lang.Class({
             this._updateCapabilities();
         }
 
-        // Unset any preedit text
-        this.set_preedit_text(null, 0);
+        if (this._preeditStr) {
+            // Unset any preedit text
+            this.set_preedit_text(null, 0);
+            this._preeditStr = null;
+        }
     },
 
     vfunc_reset() {
@@ -154,8 +157,11 @@ var InputMethod = new Lang.Class({
             this._emitRequestSurrounding();
         }
 
-        // Unset any preedit text
-        this.set_preedit_text(null, 0);
+        if (this._preeditStr) {
+            // Unset any preedit text
+            this.set_preedit_text(null, 0);
+            this._preeditStr = null;
+        }
     },
 
     vfunc_set_cursor_location(rect) {